$(function () {
	$('.bt-frame button[name=btSearch]').click(function(){
		$('form.form').find('input[name=page]').val(1);
	});
	$('.tabledata table select[name=size]').change(function(){
		$('form.form').find('input[name=page]').val(1);
		$('form.form').find('input[name=size]').val($(this).val());
		$('form.form').submit();
	});
	$('.tabledata table th').click(function(){
		var sortmember = $(this).attr("sortmember");
		if(sortmember == null){
			var text = $.trim($(this).text());
			if(text!= null && text == "#"){
				sortmember = "createtime";
			} else{
				return;
			}
		}
		$('form.form').find('input[name=orderby]').val(sortmember);
		var sortType = $('form.form').find('input[name=orderas]').val();
		if(sortType == null  || sortType == "" || sortType == "DESC" || sortType == "desc")
			sortType = "ASC";
		else
			sortType = "DESC";
		$('form.form').find('input[name=orderas]').val(sortType);
		$('form.form').submit();
	});
});